/* 
 * File:   script.h
 * Author: bjmey
 *
 * Created on September 5, 2007, 9:41 PM
 */

#ifndef _SCRIPT_H
#define	_SCRIPT_H
#include "rope.h"

#ifdef	__cplusplus
extern "C" {
#endif

struct lua_State;
typedef struct lua_State * Script;
typedef int (*Scriptfunction) (Script script);

union Scriptvalue_union {
		Rope string;
		double number;
		int integer;
};


struct Scriptvalue_struct {
	int kind;
	union Scriptvalue_union value;
};

extern Script 	script_make();
extern Script 	script_free( Script self);
extern Script 	script_eval_c( Script self, const char * script ); 
extern Script 	script_eval_r( Script self, Rope script ); 
extern Script 	script_run(Script self, const char *filename ); 
extern Rope 	script_get_rope(Script self, const char * globalname, const char *def);

extern Script 	script_setglob_string(Script self, const char *varname, const char *value );

#ifdef	__cplusplus
}
#endif

#endif	/* _SCRIPT_H */

